package net.towee.client.com.repo;

import net.towee.client.com.repo.presenter.DiscussionShowerPresenter;
import net.towee.client.com.repo.presenter.RepositoryDocumentEditorPresenter;
import net.towee.client.com.repo.presenter.RepositoryDocumentPresenter;
import net.towee.client.com.repo.presenter.RepositoryExplorerPresenter;
import net.towee.client.com.repo.presenter.RepositoryNodeCreatorPresenter;
import net.towee.client.com.repo.presenter.RepositoryNodeSelectorPresenter;
import net.towee.client.com.repo.presenter.RepositoryPresenter;
import net.towee.client.com.repo.presenter.RepositoryShowerPresenter;
import net.towee.client.com.repo.presenter.RepositoryTreeNodePresenter;
import net.towee.client.com.repo.view.DiscussionShowerView;
import net.towee.client.com.repo.view.RepositoryDocumentEditorView;
import net.towee.client.com.repo.view.RepositoryDocumentView;
import net.towee.client.com.repo.view.RepositoryExplorerView;
import net.towee.client.com.repo.view.RepositoryNodeCreatorView;
import net.towee.client.com.repo.view.RepositoryNodeSelectorView;
import net.towee.client.com.repo.view.RepositoryShowerView;
import net.towee.client.com.repo.view.RepositoryTreeNodeView;
import net.towee.client.com.repo.view.RepositoryView;

import com.google.gwt.inject.client.AbstractGinModule;
import com.google.inject.Singleton;

public class RepositoryModule extends AbstractGinModule {

	@Override
	protected void configure() {
		bind(Repository.class).to(RepositoryPresenter.class).in(Singleton.class);
		bind(RepositoryPresenter.Display.class).to(RepositoryView.class).in(Singleton.class);

		bind(RepositoryExplorer.class).to(RepositoryExplorerPresenter.class).in(Singleton.class);
		bind(RepositoryExplorerPresenter.Display.class).to(RepositoryExplorerView.class).in(Singleton.class);

		bind(RepositoryShower.class).to(RepositoryShowerPresenter.class).in(Singleton.class);
		bind(RepositoryShowerPresenter.Display.class).to(RepositoryShowerView.class).in(Singleton.class);
		
		bind(RepositoryTreeNodeShower.class).to(RepositoryTreeNodePresenter.class);
		bind(RepositoryTreeNodePresenter.Display.class).to(RepositoryTreeNodeView.class);
	
		bind(RepositoryDocumentShower.class).to(RepositoryDocumentPresenter.class);
		bind(RepositoryDocumentPresenter.Display.class).to(RepositoryDocumentView.class);
		
		bind(RepositoryNodeSelector.class).to(RepositoryNodeSelectorPresenter.class);
		bind(RepositoryNodeSelectorPresenter.Display.class).to(RepositoryNodeSelectorView.class);
		
		// Creator and different views for each document type
		bind(RepositoryDocumentEditor.class).to(RepositoryDocumentEditorPresenter.class);
		bind(RepositoryDocumentEditorPresenter.Display.class).to(RepositoryDocumentEditorView.class);
		
		// Nodes creator
		bind(RepositoryNodeCreator.class).to(RepositoryNodeCreatorPresenter.class);
		bind(RepositoryNodeCreatorPresenter.Display.class).to(RepositoryNodeCreatorView.class);
		
		// Discussions
		bind(DiscussionShower.class).to(DiscussionShowerPresenter.class);
		bind(DiscussionShowerPresenter.Display.class).to(DiscussionShowerView.class);
	}

}
